<style type="text/css">
.uu_mail_box {
	margin:10px;
	border:4px solid #09C;
	overflow:hidden;
}
.uu_mail_header {
	background:#09C;
	padding:0px 10px;
	position:relative;
	line-height:50px;
	color:#fff;
	font-size:12px;
}
#uu_mail_content {
	padding:10px;
	background:#fff;
}
#uu_mail_content p {
	margin:0px;
	padding:0px;
	line-height:30px;
	font-size:14px;
}
.uu_mail_table {
	font-size:12px;
	line-height:30px;
	background:#ddd;
}
.uu_mail_table th {
width:80px;
text-align:center;
}
.uu_mail_table tr {
	background:#fff;
}
.uu_mail_table tr:hover {
	background:#f8f8f8;
}
.alarm_parame, .alarm_item, .alarm_condition, .alarm_way {
	border-bottom:1px solid #aaa;
	padding:5px 40px;
	line-height:30px;
}
.alarm_condition p {
	padding:5px 0px;
}
.item_title {
	background: none repeat scroll 0 0 #F0F0F0;
	border-bottom: 1px solid #AAAAAA;
	height: 22px;
	line-height: 22px;
	margin: 1px auto 0;
	overflow: hidden;
	padding: 5px 13px 7px;
}
</style>
<div class="uu_mail_box">
  <div class="uu_mail_header"> <span style="float:right;">此为系统告警邮件，请勿回复。</span> <img src="http://auto.netsense.cn/public/logo/auto.netsense.cn.logo.png" border="0" /> </div>
  <div id="uu_mail_content">
    <p style="padding:5px 0px;">尊敬的
      <$username>
      ，AutoSense自动化拨测系统发现您的平台或应用出现问题，具体信息请参考以下数据：</p>
    <p>
    <div tabname="alarm_parame" class="item_title">告警信息</div>
    <table width="100%" border="0" cellspacing="1" cellpadding="1" class="uu_mail_table">
      <tr>
        <th scope="col">告警名称</th>
        <td><?php echo $info['alarm_name'];?>
          <span style="margin-left:200px; display:inline; font-weight:bold;">
            <?php if($info['isobject']){?>
            按目标网站告警
            <?php }else{?>
            不按目标网站告警
            <?php }?>
          </span></td>
      </tr>
      <?php if($info['testplan']){?>
      <tr>
        <th scope="col">计划名称</th>
        <td><?php echo $info['testplan'];?></td>
      </tr>
       <?php }?>
       <?php if($info['did']){?>
      <tr>
        <th scope="col">目标终端</th>
        <td><?php echo $info['model'];?></td>
      </tr>
      <?php }?>
       <?php if($info['object']){?>
      <tr>
        <th scope="col">目标网站</th>
        <td><?php echo $info['object'];?></td>
      </tr>
	  <?php }?>
    </table>
    </p>
    <p>
    <div tabname="alarm_parame" class="item_title">检查项</div>
    <table width="100%" border="0" cellspacing="1" cellpadding="1" class="uu_mail_table">
      <tr>
        <th scope="col">结果状态</th>
        <td>状态：等于<?php echo $info['status'];?></td>
      </tr>
      <?php if($info['score']){?>
      <tr>
        <th scope="col">评分</th>
        <td><?php echo $info['relation'];?>　小于<?php echo $info['score'];?></td>
      </tr>
      <?php }?>
    </table>
    </p>
    <p>
    <div tabname="alarm_parame" class="item_title">告警条件</div>
    <div class="alarm_condition">
      <?php if(1==$info['type']){?>
      <p>
        <label for="con-1">在测试结果中符合检查项连续 <?php echo $info['type_count']; ?> 次</label>
      </p>
      <?php }else{?>
      <p>
        <label for="con-2">在 <?php echo ($info['type']==2) ? $info['type_n_count'] : '';?> 次测试结果中符合检查项达到 <?php echo ($info['type']==2) ? $info['type_m_count'] : '';?> 次</label>
      </p>
      <?php }?>
    </div>
    </p>
         <!--告警数据-->
    <p>
    <div class="item_title" tabname="alarm_item">告警明细</div>
    <table width="100%" border="0" cellspacing="1" cellpadding="1" class="uu_mail_table">
      <tr>
        <th scope="col">目标网站</th>
        <th scope="col">详情</th>
      </tr>
      <?php foreach($result as $list){ ?>
      <tr>
        <td><?php if($info['isobject']){echo $list['object'];}else{echo '不按目标网站';}?></td>
        <td>
          <table width="100%" border="0" cellspacing="1" cellpadding="1" class="uu_mail_table">
            <tr>
                <th scope="col">原因</th>
                <th scope="col">目标网站</th>
                <th scope="col">计划名称</th>
                <th scope="col">设备信息</th>
                <th scope="col">地区</th>
                <th scope="col">结果入库时间</th>
          </tr>
           <?php foreach($list['mx'] as $mx){ ?>
          	 <tr>
           		<td><?php echo $mx['status'];?>&nbsp;<a href="http://wasu.netsense.cn/nresult/result&resultid=<?php echo  $mx['resultid'];?>">查看结果</a></td>
                <td><?php echo $mx['object']?></td>
                <td><?php echo $mx['tpname']?></td>
                <td><?php echo $mx['DevType']?></td>
                <td><?php echo $mx['location']?></td>
                <td><?php echo $mx['date']?></td>
            </tr>
           <?php };?>
          </table>
        </td>
      </tr>
      <?php }; ?>
    </table>
    </p>
    <p> <br />
      <span>更多信息请登录自动化拨测系统查看。</span> <br />
    </p>
  </div>
</div>
